/*
 * @Description: 登录模块
 * @Version: 1.0
 * @Author: Shi Hexiang
 * @Date: 2023-09-20 16:12:34
 * @LastEditors: yxx
 * @LastEditTime: 2024-12-09 14:43:53
 */
import http from "@/api"
import { LoginRes } from "@/api/interface/login/response"
import { LoginReq } from "@/api/interface/login/request"

// ------------------登录模块------------------ //
// 登录模块 获取验证码
export const getCodeApi = () => {
  return http.get<LoginRes.CodeInfo>("/sys/code", {}, { loading: false })
}
// 登录模块 用户登录
export const loginApi = (params: LoginReq.Login) => {
  return http.post<LoginRes.UserInfo>("/sys/login", params, { loading: false })
}
// 登录模块 获取菜单按钮列表
export const getAuthMenuListApi = () => {
  return http.get<LoginRes.UserPermissions>("/sys/permission", {}, { loading: false })
}
// 登录模块 退出登录
export const logoutApi = () => {
  return http.get("sys/logout")
}
// 登录模块 修改密码
export const modifyPasswordApi = (params: LoginReq.ModifyPassword) => {
  return http.post("/sys/user/modify/password", params, { loading: false })
}
